package cn.iocoder.yudao.module.blog.controller.app.jiucaselevel;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.blog.controller.admin.jiucaselevel.vo.BlogJiuCaseLevelRespVO;
import cn.iocoder.yudao.module.blog.convert.jiucaselevel.BlogJiuCaseLevelConvert;
import cn.iocoder.yudao.module.blog.dal.dataobject.jiucaselevel.BlogJiuCaseLevelDO;
import cn.iocoder.yudao.module.blog.service.jiucaselevel.BlogJiuCaseLevelService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 灸法案例审批等级")
@RestController
@RequestMapping("/blog/jiu-case-level")
@Validated
public class AppJiuCaseLevelController {

    @Resource
    private BlogJiuCaseLevelService jiuCaseLevelService;

    @GetMapping("/all")
    @Operation(summary = "获得灸法案例审批等级列表")
    public CommonResult<List<BlogJiuCaseLevelRespVO>> getJiuCaseLevelList() {
        List<BlogJiuCaseLevelDO> list = jiuCaseLevelService.getAll();
        return success(BlogJiuCaseLevelConvert.INSTANCE.convertList(list));
    }
}
